package com.quick.tim.mobileserviceprovider.entity;
// Generated 5 Jun, 2013 6:08:00 PM by Hibernate Tools 3.2.1.GA


import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;

/**
 * UserMaster generated by hbm2java
 */
@Entity
@Table(name="user_master", schema="public"
    , uniqueConstraints = @UniqueConstraint(columnNames="prn") 
)
public class UserMaster  implements java.io.Serializable {


     private String username;
     private int prn;
     private String password;
     private String name;
     private Long creationdate;
     private Long mobile;
     private Set<QuickNotes> quickNoteses = new HashSet<QuickNotes>(0);
     private Set<Sub> subs = new HashSet<Sub>(0);
     private Set<StudentMaster> studentMasters = new HashSet<StudentMaster>(0);
     private Set<UserRoles> userRoleses = new HashSet<UserRoles>(0);
     private Set<TeacherStddivSub> teacherStddivSubs = new HashSet<TeacherStddivSub>(0);
     private Set<Std> stds = new HashSet<Std>(0);
     private Set<QualificationMaster> qualificationMasters = new HashSet<QualificationMaster>(0);
     private Set<TeacherMaster> teacherMasters = new HashSet<TeacherMaster>(0);
     private Set<StudentExamSummary> studentExamSummaries = new HashSet<StudentExamSummary>(0);
     private Set<ExamStudentResponse> examStudentResponses = new HashSet<ExamStudentResponse>(0);

    public UserMaster() {
    }

	
    public UserMaster(String username, int prn) {
        this.username = username;
        this.prn = prn;
    }
    public UserMaster(String username, int prn, String password, String name, Long creationdate, Long mobile, Set<QuickNotes> quickNoteses, Set<Sub> subs, Set<StudentMaster> studentMasters, Set<UserRoles> userRoleses, Set<TeacherStddivSub> teacherStddivSubs, Set<Std> stds, Set<QualificationMaster> qualificationMasters, Set<TeacherMaster> teacherMasters, Set<StudentExamSummary> studentExamSummaries, Set<ExamStudentResponse> examStudentResponses) {
       this.username = username;
       this.prn = prn;
       this.password = password;
       this.name = name;
       this.creationdate = creationdate;
       this.mobile = mobile;
       this.quickNoteses = quickNoteses;
       this.subs = subs;
       this.studentMasters = studentMasters;
       this.userRoleses = userRoleses;
       this.teacherStddivSubs = teacherStddivSubs;
       this.stds = stds;
       this.qualificationMasters = qualificationMasters;
       this.teacherMasters = teacherMasters;
       this.studentExamSummaries = studentExamSummaries;
       this.examStudentResponses = examStudentResponses;
    }
   
     @Id 
    
    @Column(name="username", unique=true, nullable=false, length=250)
    public String getUsername() {
        return this.username;
    }
    
    public void setUsername(String username) {
        this.username = username;
    }
    
    @Column(name="prn", unique=true, nullable=false)
    public int getPrn() {
        return this.prn;
    }
    
    public void setPrn(int prn) {
        this.prn = prn;
    }
    
    @Column(name="password", length=200)
    public String getPassword() {
        return this.password;
    }
    
    public void setPassword(String password) {
        this.password = password;
    }
    
    @Column(name="name", length=200)
    public String getName() {
        return this.name;
    }
    
    public void setName(String name) {
        this.name = name;
    }
    
    @Column(name="creationdate")
    public Long getCreationdate() {
        return this.creationdate;
    }
    
    public void setCreationdate(Long creationdate) {
        this.creationdate = creationdate;
    }
    
    @Column(name="mobile")
    public Long getMobile() {
        return this.mobile;
    }
    
    public void setMobile(Long mobile) {
        this.mobile = mobile;
    }
@OneToMany(cascade=CascadeType.ALL, fetch=FetchType.LAZY, mappedBy="userMaster")
    public Set<QuickNotes> getQuickNoteses() {
        return this.quickNoteses;
    }
    
    public void setQuickNoteses(Set<QuickNotes> quickNoteses) {
        this.quickNoteses = quickNoteses;
    }
@ManyToMany(fetch=FetchType.LAZY)
    @JoinTable(name="public.teacher_sub", joinColumns = { 
        @JoinColumn(name="username", nullable=false, updatable=false) }, inverseJoinColumns = { 
        @JoinColumn(name="sub", nullable=false, updatable=false) })
    public Set<Sub> getSubs() {
        return this.subs;
    }
    
    public void setSubs(Set<Sub> subs) {
        this.subs = subs;
    }
@OneToMany(cascade=CascadeType.ALL, fetch=FetchType.LAZY, mappedBy="userMaster")
    public Set<StudentMaster> getStudentMasters() {
        return this.studentMasters;
    }
    
    public void setStudentMasters(Set<StudentMaster> studentMasters) {
        this.studentMasters = studentMasters;
    }
@OneToMany(cascade=CascadeType.ALL, fetch=FetchType.EAGER, mappedBy="userMaster")
    public Set<UserRoles> getUserRoleses() {
        return this.userRoleses;
    }
    
    public void setUserRoleses(Set<UserRoles> userRoleses) {
        this.userRoleses = userRoleses;
    }
@OneToMany(cascade=CascadeType.ALL, fetch=FetchType.LAZY, mappedBy="userMaster")
    public Set<TeacherStddivSub> getTeacherStddivSubs() {
        return this.teacherStddivSubs;
    }
    
    public void setTeacherStddivSubs(Set<TeacherStddivSub> teacherStddivSubs) {
        this.teacherStddivSubs = teacherStddivSubs;
    }
@ManyToMany(fetch=FetchType.LAZY)
    @JoinTable(name="public.teacher_std", joinColumns = { 
        @JoinColumn(name="username", nullable=false, updatable=false) }, inverseJoinColumns = { 
        @JoinColumn(name="std", nullable=false, updatable=false) })
    public Set<Std> getStds() {
        return this.stds;
    }
    
    public void setStds(Set<Std> stds) {
        this.stds = stds;
    }
@ManyToMany(fetch=FetchType.LAZY)
    @JoinTable(name="public.teacher_qualification", joinColumns = { 
        @JoinColumn(name="username", nullable=false, updatable=false) }, inverseJoinColumns = { 
        @JoinColumn(name="qualification_name", nullable=false, updatable=false) })
    public Set<QualificationMaster> getQualificationMasters() {
        return this.qualificationMasters;
    }
    
    public void setQualificationMasters(Set<QualificationMaster> qualificationMasters) {
        this.qualificationMasters = qualificationMasters;
    }
@OneToMany(cascade=CascadeType.ALL, fetch=FetchType.LAZY, mappedBy="userMaster")
    public Set<TeacherMaster> getTeacherMasters() {
        return this.teacherMasters;
    }
    
    public void setTeacherMasters(Set<TeacherMaster> teacherMasters) {
        this.teacherMasters = teacherMasters;
    }
@OneToMany(cascade=CascadeType.ALL, fetch=FetchType.LAZY, mappedBy="userMaster")
    public Set<StudentExamSummary> getStudentExamSummaries() {
        return this.studentExamSummaries;
    }
    
    public void setStudentExamSummaries(Set<StudentExamSummary> studentExamSummaries) {
        this.studentExamSummaries = studentExamSummaries;
    }
@OneToMany(cascade=CascadeType.ALL, fetch=FetchType.LAZY, mappedBy="userMaster")
    public Set<ExamStudentResponse> getExamStudentResponses() {
        return this.examStudentResponses;
    }
    
    public void setExamStudentResponses(Set<ExamStudentResponse> examStudentResponses) {
        this.examStudentResponses = examStudentResponses;
    }




}


